<template>
    <p>这是子组件</p>
   <p>msg：{{ msg }}</p> 
   <button @click="updateMsg">修改父组件的值</button>
</template>

<script setup>

const props = defineProps(['msg'])
//1.定义一个事件，让父组件监听
const emit = defineEmits(['childEmit'])
//2.给父组件传值

function updateMsg(){
    emit('childEmit','adadsdada')
}

</script>